<html  xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>财富管家-项目管理-待审核</title>
  <meta name="renderer" content="webkit|ie-comp|ie-stand">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="shortcut icon" th:href="@{images/littlelogo.png}" >
  <link rel="icon" th:href="@{/favicon.ico}"  mce_href="/favicon.ico" type="image/x-icon"/>
  <link rel="stylesheet" th:href="@{/css/font.css}">
  <link rel="stylesheet" th:href="@{/css/xadmin.css}">
  <script type="text/javascript" th:src="@{/js/jquery-3.2.1.min.js}"></script>
  <script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
  <script type="text/javascript" th:src="@{/js/xadmin.js}"></script>

  <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
  <!--[if lt IE 9]>
  <script th:src="@{/js/html5.min.js}" type="text/javascript"></script>
  <script th:src="@{/js/respond.min.js}" type="text/javascript"></script>
  <![endif]-->
</head>
  
  <body class="layui-anim layui-anim-up">
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <!--<a href="">演示</a>-->
        <a>
          <cite>待审核项目</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      <!--<div class="layui-row">
        <form class="layui-form layui-col-md12 x-so">
          <input class="layui-input" placeholder="开始日" name="start" id="start">
          <input class="layui-input" placeholder="截止日" name="end" id="end">
          <input type="text" name="username"  placeholder="请输入用户名" autocomplete="off" class="layui-input">
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>
      </div>-->
      <xblock>
        <!--<button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button>-->
        <!--<button class="layui-btn" onclick="x_admin_show('添加用户','./member-add.html',600,400)"><i class="layui-icon"></i>添加</button>-->
        <span class="x-right" style="line-height:40px" th:text="'共有数据：'+${num}+'条'">共有数据：88 条</span>
      </xblock>
      <table class="layui-table">
        <thead>
          <tr>
          <!--  <th>
            <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
          </th>-->
            <th>项目编号</th>
            <th>项目名称</th>
            <th>项目发起人</th>
            <th>项目类型</th>
            <th>用户额度</th>
            <th>项目金额</th>
            <th>项目回报率</th>
            <th>项目月还款</th>
            <th>项目期数</th>
            <th>项目扣款日</th>
            <th>项目完成进度</th>
            <th >操作</th>
        </thead>
        <tbody>
          <tr th:each="examine:${examines}">
            <!--<td>
              <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='2'><i class="layui-icon">&#xe605;</i></div>
            </td>-->
            <td th:text="'201800'+${examine.id}">201811080001</td>
            <td th:text="'抵押贷-'+${examine.projectname}">车易贷-180918H01-孙先生车辆抵押贷</td>
            <td th:text="${examine.username}">孙先生</td>
            <td>抵押贷</td>
            <td th:text="${examine.usermoney}">150000.0</td>
            <td th:text="${examine.projectmoney}">100000.0</td>
            <td th:text="${examine.projectrateofreturn}+'%'">10.0%</td>
            <td th:text="${examine.projectmonthlyreturn}">833.0</td>
            <td th:text="${examine.projectborrowtime}">10期</td>
            <td>15日</td>
            <td class="td-status">
              <span class="layui-btn layui-btn-normal layui-btn-mini">待审核</span></td>
            <td class="td-manage">
              <a class="test" th:onclick="'javascript:member_stop('+this+','+${examine.id}+')'" href="javascript:void(0);"  title="通过">
                <i class="layui-icon">&#xe62f;</i>
              </a>
              <a title="项目展示" th:onclick="'javascript:project_show('+${examine.id}+')'" href="javascript:void(0);">
                <i class="layui-icon">&#xe63c;</i>
              </a>
              <a title="提额" th:onclick="'javascript:project_add('+${examine.userid}+','+${examine.usermoney}+')'" href="javascript:void(0);">
                <i class="layui-icon">&#xe65e;</i>
              </a>
              <a class="test" title="驳回" th:onclick="'javascript:member_del('+this+','+${examine.id}+')'" href="javascript:void(0);" >
                <i class="layui-icon">&#xe640;</i>
              </a>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <div id="pagination" style="text-align: center"></div>



    <script th:inline="javascript">
        var contextPath = [[${#request.getContextPath()}]]; //获取当前应用路径
        var count = [[${count}]];
        var curr = [[${curr}]];//当前页
    </script>
    <script>
      layui.use('laydate', function(){
        var laydate = layui.laydate;
        
        //执行一个laydate实例
        laydate.render({
          elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
          elem: '#end' //指定元素
        });
      });

       /*用户-通过*/
      function member_stop(obj,id){
          layer.confirm('确认要通过吗？',function(index){
              if($(obj).attr('title')=='通过'){
                //发异步把用户状态进行更改

                $(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('已通过');
                layer.msg('已通过!',{
                    icon: 6,
                    time:1000
                    ,end:function () {
                        $.ajax({
                            type : "post",
                            url : contextPath+"/home/project_update_step?id="+id,
                            async : true,
                            data:{},
                            dataType:"JSON",
                            success : function(data){
                                console.log(data);
                            }
                        })
                    }
                });
              }
          });
      }

      /*用户-驳回*/
      function member_del(obj,id){
          layer.confirm('确认驳回吗？',function(index){

              ////发异步把用户状态进行更改

              $(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('已驳回');

              layer.msg('已删除!',{
                  icon: 1,
                  time:1000
                  ,end:function () {
                      $.ajax({
                          type : "post",
                          url : contextPath+"/home/project_update_stepThird?id="+id,
                          async : true,
                          data:{},
                          dataType:"JSON",
                          success : function(data){
                              console.log(data);
                          }
                      })
                  }
              });
          });
      }
    </script>

    <script type="text/javascript">
        function project_show(id){
            layer.open({
                type: 2,
                area: ['1000px', '605px'],
                fix: false, //不固定
                maxmin: true,
                shadeClose: true,
                shade:0.4,
                title: '项目展示' ,
                content: contextPath+"/home/project_show?id="+id
            });
        }
    </script>
    <!--提额-->
    <script type="text/javascript">
        function project_add(userid,money){
            layer.open({
                type: 2,
                area: ['600px', '270px'],
                fix: false, //不固定
                maxmin: true,
                shadeClose: true,
                shade:0.4,
                title: '提额',
                content:contextPath + '/home/addUserMoney?id=' + userid+'&money='+money
            });
        }
    </script>
    <script type="text/javascript">
        //使用layui分页
        layui.use('laypage', function(){
            var laypage = layui.laypage;
            //执行一个laypage实例
            laypage.render({
                elem: 'pagination' //注意，这里的 data 是 ID，不用加 # 号
                ,count: count  //数据总数，从服务端得到
                ,curr: curr
                // , layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
                ,limit: 10
                ,jump: function(obj, first){
                    //obj包含了当前分页的所有参数，比如：
                    // console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
                    // console.log(obj.limit); //得到每页显示的条数

                    //首次不执行
                    if(!first){
                        window.location.href = contextPath + "/home/project_examine?page=" + (obj.curr) + "&size=" + obj.limit
                        //   pagination(obj.curr, obj.limit);//第二个参数不能用变量pageSize，因为当切换每页大小的时候会出问题
                    }
                }
            });
        });
    </script>
    <!--记录浏览数-->
    <!--<script>var _hmt = _hmt || []; (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();</script>-->
  </body>

</html>